using System.Collections.Generic;
using System.Threading.Tasks;
using mapshiftApplication.Dto;
using mapshiftApplication.Repositories;

namespace mapshiftApplication.Services
{
    public class TsmcConfigService
    {
        private readonly ITsmcConfigRepository _configRepository;

        public TsmcConfigService(ITsmcConfigRepository configRepository)
        {
            _configRepository = configRepository;
        }

        public async Task<IEnumerable<TsmcConfigDto>> GetAllTsmcConfigsAsync()
        {
            return await _configRepository.GetAllAsync();
        }

        public async Task<TsmcConfigDto> GetTsmcConfigByIdAsync(string id)
        {
            return await _configRepository.GetByIdAsync(id);
        }

        public async Task<string> CreateTsmcConfigAsync(TsmcConfigDto config)
        {
            return await _configRepository.AddAsync(config);
        }

        public async Task<int> UpdateTsmcConfigAsync(TsmcConfigDto config)
        {
            return await _configRepository.UpdateAsync(config);
        }

        public async Task<int> DeleteTsmcConfigAsync(string id)
        {
            return await _configRepository.DeleteAsync(id);
        }
    }
}
